<!DOCTYPE html>
<#assign ctx = request.contextPath />
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1 ,minimum-scale=1.0 ,maximum-scale=1.0" user-scalable=no>
<title>当前订单</title>
<link href="${ctx}/assets/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="${ctx}/assets/css/weixing.css" />
<link rel="stylesheet" href="${ctx}/assets/css/hook.css" />
</head>
<body >
<div class="hook" id="hook">
</div>
  	<ul id="thelist">
  
	</ul>
	<div style="text-align:center" id="loadmore">
	</div>	    
<script src="${ctx}/assets/js/jquery-1.11.0.min.js"></script>
<script src="${ctx}/assets/js/bootstrap.min.js"></script>
<script src="${ctx}/assets/js/mousewheel.js"></script>
<script src="${ctx}/assets/js/hook.js"></script>
<script type="text/javascript">
var myScroll,
	pullDownEl, pullDownOffset,
	pullUpEl, pullUpOffset,
	generatedCount = 0;
function load () {
		 	$.ajax({
             type: "GET",
             url: "${ctx}/wx/v1/todayOrder3",
             data: {
             'phone':'${phone}'
             },	
             dataType: "json",
             success: function(data){
             if(data.length==0 && $("li > div").val()==null){
             $("#loadmore").html("暂无当前订单");
             }
             	var content="";
             	var orderNumber,created,orderDriverName,orderDriverPhone,fromPlace,status;
 				$.each(data, function (i,order) { 
 				orderNumber=order.orderNumber;
 				created=order.created;
 				orderDriverName=order.orderDriverName==null?"":order.orderDriverName;
 				//orderDriverPhone=order.orderDriverPhone==null?"":order.orderDriverPhone;
 				fromPlace=order.fromPlace;
 				status=order.status;
 				  content+='<li  class="list-group">';
 				  content+='<div class="list-group-item active">';
 				  content+='<p style="text-align:left; float: left; margin-bottom: 0px;">订单号:';
 				  content+=orderNumber;
 				  content+='</p>';
 				  content+='<p style="text-align: right; margin-bottom: 0px;">预约时间:';
 				  content+=created;
 				  content+='</p>';
 				  content+='</div>';
 				  content+='<div class="list-group-item">';
 				  content+='<p style="text-align:left; float: left; margin-bottom: 0px;">服务人员:</p>';
 				  content+='<p style="text-align: right; margin-bottom: 0px;">';
 				  content+=orderDriverName;
 				  //content+=orderDriverPhone;
 				  content+='&ensp;</p>';
 				  content+='</div>';
 				  content+='<div class="list-group-item">';
 				  content+='<p style="text-align:left; float: left; margin-bottom: 0px;">预约地址:</p>';
 				  content+='<p style="text-align: right; margin-bottom: 0px; ">';
 				  content+=fromPlace;
 				  content+='&ensp;</p>';
 				  content+='</div>';
 				  content+='<div class="list-group-item">';
 				  content+='<p style="text-align:left; float: left; margin-bottom: 0px;">当前状态:</p>';
 				  content+='<p style="text-align: right; margin-bottom: 0px;">';
 				  content+=status;
 				  content+='</p>';
 				  content+='</div></li>';
 				}); 
			       	 $("#thelist").empty();
			         $("#thelist").append(content);	 
              }
       	});
}

$(document).ready(function(){
	load();
	$('#hook').hook({
		reloadPage:false,
		reloadEl:function(){
			load();
		}
	});
	
});
</script>   
</body>
</html>